Java is a popular and widely used high-level programming language. A computer program written in Java source code is compiled into Java byte code, hereinafter referred to as a Java application, and is interpreted upon execution by a so-called Java virtual machine (JVM). The JVM transforms the byte code into executable instructions specific to the platform on which the Java application and the Java virtual machine are run. In this way, providing that only functionality within the JVM is used by the Java application, Java developers can write Java applications that are largely portable and executable on any platform having an appropriate JVM. Such an arrangement thereby removes the need for Java developers to have specific knowledge about individual execution platforms and is one of the reasons why the Java programming language has become so popular over recent years.
In many circumstances Java applications are less efficient than applications written in generally non-portable languages such as C, C++ and assembly language. The lower efficiency is mainly due to the fact that, for portability reasons, much low-level platform specific functionality which is easily accessible from C and C++ is not available directly through Java. However, where Java applications are required because they have platform independence, efficiency is not usually of primary concern and the advantages brought by portability generally outweigh any disadvantages regarding performance.
In the field of telecommunications there is an increasing desire to write telecommunication applications in Java, due in part to its relative ease of use. However, one of the problems posed with writing applications in Java, particularly in the telecommunications field, is that the much of underlying telecommunications systems are controlled by legacy applications written in languages other than Java. This is largely for historical reasons and partly because Java is not generally a good choice of language especially where high performance low-level functionality is required. Accordingly, a Java application written for a telecommunications system is generally required to access existing legacy applications or programs written in other languages, especially where access to low-level functionality, such as interacting with a communicating module, such as a communication stack, is required.
In order for a Java application to access an application or program written in a language other than Java (hereinafter referred to as a ‘native application’) the Java native interface (JNI) can be used. The Java Native Interface (JNI) is a documented and supported specification that allows native applications, for example written in C, C++ or assembly language, to be called from a Java application. The JNI can also enable native applications, under certain circumstances, to call a Java application. The JNI may be considered as an additional library that can map Java methods to corresponding native functions.
Not surprisingly, use of the JNI generally introduces some performance overhead, especially where data is transferred between a Java application and a native application. Where such data transfers are required it may be necessary to perform a translation from, for example, a Java data object to a C structure, or vice-versa. In many situations, for example where a Java application is required to access or schedule an asynchronous communication stack, the Java application may be required to make considerable use of the JNI and hence may incur considerable performance overhead. Such situations are common, for example in telecommunications systems
One aim of the present invention is to mitigate at least some of the aforementioned problems.